home *** CD-ROM | disk | FTP | other *** search
- // Copyright (C) 1997-2002 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
- //
- // Alias|Wavefront Script File
- // MODIFY THIS AT YOUR OWN RISK
- //
- // Creation Date: November 29, 1996
- // Author: mm
- //
- // Description:
- // This a helper script which will add the currently selected
- // objects to the mainListConnection of an editor.
- //
- // Input Arguments:
- // The name of the editor to modify
- //
- // Return Value:
- // None.
- //
-
- global proc
- addSelectedToEditor (string $editor)
- {
- // Make sure the editor exists
- //
- if (!`editor -exists $editor`) {
- error "Editor not found";
- }
- // First, find out what is connected to this editor
- //
- string $mainListConnection = `editor -query -mainListConnection $editor`;
- // If it is the active list, then there is nothing to be done
- //
- if (($mainListConnection == "activeList") || ($mainListConnection == "animationList") || ($mainListConnection == "")) {
- return;
- }
- // If this is a modelEditor, then we can add the members directly
- //
- if (`modelEditor -exists $editor`) {
- modelEditor -edit -addSelected $editor;
- return;
- }
- // Create a locked copy of the current activeList
- //
- string $activeList = `selectionConnection -lock true -activeList -parent $editor`;
- // Check to see if this is a list connection
- //
- if (`selectionConnection -query -identify $mainListConnection` == "listList") {
- // It is, so just add the active list to it
- //
- selectionConnection -edit -add $activeList $mainListConnection;
- }
- else {
- // We need to create a new list connection to hold the original
- // connection + the active list
- //
- string $connection = `selectionConnection -connectionList -add $mainListConnection -parent $editor`;
- selectionConnection -edit -add $activeList $connection;
- // And attach it to the editor
- //
- editor -edit -mainListConnection $connection $editor;
- }
- }
-